<template>
	<!-- 职场 -->
	<view class="bigbox box pb50">
		<!-- 头部图片 -->
		<view class="mt28 flex row-center" @tap="$jump('/pages/my/VIP/VIP?type=5')">
			<image src="/static/img/index/10zhichang-banner.png" class="w718 h207 text"></image>
		</view>
		<!-- /头部图片 -->

		<!-- banner部分 -->
		<view class="bannerbox">
			<!-- banner每一项 -->
			<view class="bannerbox-item pl26 pt32 pb38 pr26 mt26" @tap="$jump('/pages/home/WorkPlace/ArticleDetails/ArticleDetails?id='+item.id)" v-for="(item,index) in list" :key="index">
				<view class="mb26 bannerbox-item-tit">{{item.title}}</view>
				<view class="mb26">{{item.createtime}} </view>
				<view class="">{{item.name}}</view>
			</view>
			<!-- /banner每一项 -->
		</view>
		<!-- /banner部分 -->

		<!-- 底部咨询图片 -->
		<view class="footerimg" @click="gotocustomerService">
			<image src="/static/img/index/9VIPdetail-info.png" class="w254 h107"></image>
		</view>
		<!-- /底部咨询图片 -->
		
		<!-- 提示卡通会员的弹层 -->
		<u-popup v-model="showModel" mode='center'>
			<view class="popbox flex col-center row-column row-between pl28 pr28">
				<image src="~@/static/img/index/3liepin-pop.png" class="w160 h200"></image>
				<view class="">
					您还不是VIP会员，快去开通吧~
				</view>
				<view class="popbtn flex h120 pt26 pb26 col-center">
						<view class="popbtnleft flex1 text-center" @click="showModel=false">
							取消
						</view>
						<view class="popbtnright VIPInfoTit flex1 text-center" @click="$jump('/pages/my/VIP/VIP')">
							去开通
						</view>
				</view>
			</view>
		</u-popup>
	</view>
</template>

<script>
	export default {
		name:'WorkPlace',
		data() {
			return {
				list: [],
				//判断是不是会员
				vip:uni.getStorageSync('userInfo').workplace_level,
				showModel:false
			};
		},
		onLoad() {
			this.woindex()
		},
		methods: {
			woindex() {
				this.$api.woindex().then(res => {
					this.list = res.data
				})
			},
			gotocustomerService() {
				if(this.vip==0) {
					console.log(111)
					this.showModel=true
				}else {
					uni.navigateTo({
						url:'/pages/msg/msg'
					})
				}
			}
		}
	}
</script>

<style lang="scss">
	.bannerbox {
		.bannerbox-item {
			background-color: #FFFFFF;
			box-shadow: 0px 6rpx 20rpx 0px #E8EAEF;
			border-radius: 14rpx;
			font-size: 22rpx;
			font-weight: 500;
			color: #6D788B;

			.bannerbox-item-tit {
				font-size: 30rpx;
				font-weight: bold;
				color: #0C162E;
			}
		}
	}

	.footerimg {
		position: fixed;
		bottom: 104rpx;
		right: 20rpx;
	}
	.popbox {
		width: 700rpx;
		height: 460rpx;
		background-color: #FFFFFF;
		box-shadow: 0px 6rpx 26prx 0px rgba(70, 74, 90, 0.28);
		border-radius: 14rpx;
	}
	.popbtn {
		width: 100%;
		border-top: 2rpx solid #D2DEEB;
		.popbtnleft,{
			border-right:2rpx solid #D2DEEB ;
			font-size: 30rpx;
			color: #0C162E;
		}
		.popbtnright {
			font-size: 30rpx;
			color: #FD1D4D;
		}
	}
</style>
